package com.experienceBaby.Cashbook.greendao.db;

import com.experienceBaby.Cashbook.utils.DateUtils;

import org.greenrobot.greendao.annotation.Entity;

import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.Date;

@Entity
public class Recode {

    @Id(autoincrement = true)
    private Long id;

    /**
     * 备注
     */
    private String remark;

    /**
     * 类型
     */
    private String type;

    /**
     * 时间戳
     */
    private long date;

    /**
     * 时间
     */
    private String sDate;

    /**
     * 年
     */
    private int year;

    /**
     * 月
     */
    private int month;

    /**
     * 费用
     */
    private double cost;

    /**
     * 0:支出
     * 1:收入
     */
    private int income;

    @Generated(hash = 209808014)
    public Recode(Long id, String remark, String type, long date, String sDate,
                  int year, int month, double cost, int income) {
        this.id = id;
        this.remark = remark;
        this.type = type;
        this.date = date;
        this.sDate = sDate;
        this.year = year;
        this.month = month;
        this.cost = cost;
        this.income = income;
    }

    @Generated(hash = 149180596)
    public Recode() {
    }

    @Deprecated
    public Recode(Long id, String remark, String type, long date, String sDate, double cost, int income) {
        this.id = id;
        this.remark = remark;
        this.type = type;
        this.date = date;
        this.sDate = sDate;
        Date date1 = DateUtils.getDate(date);
        this.year = date1.getYear() + 1900;
        this.month = date1.getMonth() + 1;
        this.cost = cost;
        this.income = income;
    }

    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRemark() {
        return this.remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public long getDate() {
        return this.date;
    }

    public void setDate(long date) {
        this.date = date;
    }

    public String getSDate() {
        return this.sDate;
    }

    public void setSDate(String sDate) {
        this.sDate = sDate;
    }

    public int getYear() {
        return this.year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return this.month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public double getCost() {
        return this.cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }

    public int getIncome() {
        return this.income;
    }

    public void setIncome(int income) {
        this.income = income;
    }


}
